<?php

class pcre
{
    var $delimiter = "/";
    var $modificators = "s";

	function __construct()
	{
	    parent::__construct();

	}
	static function &escape($string)
	{
        $delimiter = "/";
        $modificators = "s";
        /* \\ + * ? [ ^ ] $ ( ) { } = ! < > | : */
        return preg_quote($string, $delimiter);
	}

	static function &match($pattern, $subject, &$subpatterns, $flags = null, $offset = null)
	{
        $delimiter = "/";
        $modificators = "s";
        return preg_match("{$delimiter}{$pattern}{$delimiter}{$modificators}", $subject, $subpatterns, $flags, $offset);
	}

	static function &replace($regex, $replace, $subject, $limit = null, $count = null)
	{
        $delimiter = "/";
        $modificators = "s";
        return preg_replace("{$delimiter}{$regex}{$delimiter}{$modificators}", $replace, $subject/*, $limit, $count*/);
	}

	function __destruct()
	{
	    parent::__destruct();
	}
}

?>